﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;

namespace School.SystemManage
{
    public partial class top : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!CookieIsExist("UserLoginName"))
            {
                RedirectPage("login.aspx");
                return;
            }

            lblUser.Text = Security.Cryptography.DESDecrypt(GetCookie("UserLoginName"), "KYLECHEN");
            lblUserRole.Text = Security.Cryptography.DESDecrypt(GetCookie("UserRole"), "KYLECHEN");
        }

        protected void ibtnExit_Click(object sender, ImageClickEventArgs e)
        {
            DeleteCookie("UserLoginName");
            DeleteCookie("UserLoginID");
            DeleteCookie("UserRole");

            RedirectPage("login.aspx");
        }
    }
}
